$(function () {
    // 自动加载公司二维码
    renderData();
})

// 渲染底部显示数据
function renderData() {
    let userCompanyIdList = sessionStorage.getItem("userCompanyIdList");
    let content = '';

    if (null !== userCompanyIdList && userCompanyIdList !== '') {
        $.each(userCompanyIdList.split('@'), function (i, item) {
            if (item.trim().length > 0) {
                content += '<div class="card">';
                content += '<div class="card-content">';
                content += '<div class="card-title">' + item.split('-')[0] + '</div>';
                content += '<div class="switch-group">';
                content += '<div class="switch-item">';
                content += '<span class="switch-label"><img src="wx/showQrCodeImg?companyId=' + item.split('-')[1] + '" width="100%" /></span>';

                content += '</div></div></div></div>';
            }
        });

        $('.mainContent').html(content);
    }
}